#include('../header.html',{active: 'pages', title:'编辑页面'})
#include('../article/_header.html')
<div id="app" class="row" v-cloak>
    <loading :active.sync="isLoading" :can-cancel="true"></loading>
    <div class="col-lg-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">编辑页面</h3>
            </div>
            <div class="panel-body">
                <input type="hidden" id="attach_url" value="${attachURL()}" />

                <form id="articleForm">
                    <input type="hidden" v-model="article.cid"/>
                    <input type="hidden" v-model="article.status"/>
                    <input type="hidden" v-model="article.allowComment" />
                    <input type="hidden" v-model="article.allowFeed" />
                    <input type="hidden" v-model="article.fmtType"/>

         			<div class="form-group col-xs-4">
                       	首页显示的文字（必须） <input class="form-control" v-model="article.slugTitle" required/>
                    </div>
                    <div class="form-group col-xs-4">
                       	 请输入文章标题（必须）<input class="form-control" v-model="article.title" required/>
                    </div>
                    <div class="form-group col-xs-4">
                       	请输入页面访问路径，如：about<input class="form-control" v-model="article.slug"/>
                    </div>
                    
                    <div class="clearfix"></div>

                    <div class="form-group col-xs-12">
                    	<div class="pull-left">{{autoSaveTime}}</div>
                        <div class="pull-right">
                            <button class="btn btn-purple btn-sm waves-effect waves-light switch-editor" @click="switchEditor">
                                	{{ switchEditorName }}
                            </button>
                        </div>
                    </div>

                    <div id="md-container" v-show="article.fmtType == 'markdown'" class="form-group col-md-12">
                        <textarea id="md-editor">${article.content}</textarea>
                    </div>
                    <div id="html-container" v-show="article.fmtType == 'html'" class="form-group col-md-12">
                        <div class="summernote"></div>
                    </div>

                    <div class="form-group col-md-3 col-sm-4">
                        <label class="col-sm-4">开启评论</label>
                        <div class="col-sm-8">
                            <div id="allowComment" class="toggle toggle-success"></div>
                        </div>
                    </div>

                    <div class="form-group col-md-3 col-sm-4">
                        <label class="col-sm-4">允许订阅</label>
                        <div class="col-sm-8">
                            <div id="allowFeed" class="toggle toggle-success"></div>
                        </div>
                    </div>

                    <div class="clearfix"></div>

                    <div class="form-group col-md-3 col-sm-4">
                        <div class="text-left">
                            <label class="col-sm-4 control-label" style="line-height: 30px;">发布时间</label>
                            <div class="col-sm-8 input-append date form_datetime">
                                <input v-model="article.createdTime" style="width: 170px;" size="16" type="text" readonly class="form-control" id="form_datetime">
                            </div>
                        </div>
                    </div>

                    <div class="form-group col-md-9 col-sm-8">
                        <div class="text-right">
                            <a class="btn btn-default waves-effect waves-light" href="/admin/pages">返回列表</a>
                            <button type="button" class="btn btn-primary waves-effect waves-light" @click="publish('publish')">
                                	发布页面
                            </button>
                            <button type="button" class="btn btn-warning waves-effect waves-light" @click="publish('draft')">
                                	存为草稿
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
#include('../article/_footer.html')
<script src="${cdnURL()}/js/edit_page.js?t=${version}" ></script>
</body>
</html>